@echo off
echo 测试配置文件功能
echo.

echo 1. 检查当前配置...
echo 当前配置文件内容：
type backend\src\main\resources\application.properties | findstr "anr\."
echo.

echo 2. 启动后端服务...
cd backend
start /B mvn spring-boot:run
cd ..

echo 等待服务启动...
timeout /t 10 /nobreak > nul

echo 3. 测试完整自动化流程...
curl -X POST http://localhost:8080/api/analysis/automation/full ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"test\",\"password\":\"test\",\"deviceSn\":\"test123\",\"phone\":\"13800138000\"}"

echo.
echo 4. 检查生成的文件结构...
echo 检查 D:\ANR-WORK 目录：
if exist "D:\ANR-WORK" (
    dir "D:\ANR-WORK" /B
) else (
    echo D:\ANR-WORK 目录不存在
)

echo.
echo 检查 D:\ANR-WORK-DETAIL 目录：
if exist "D:\ANR-WORK-DETAIL" (
    dir "D:\ANR-WORK-DETAIL" /B
) else (
    echo D:\ANR-WORK-DETAIL 目录不存在
)

echo.
echo 检查 D:\ANR-WORK\processed 目录：
if exist "D:\ANR-WORK\processed" (
    dir "D:\ANR-WORK\processed" /B
) else (
    echo D:\ANR-WORK\processed 目录不存在
)

echo.
echo 测试完成！
echo 如果看到文件按照配置的路径生成，说明配置功能正常工作。
pause
